#include "testApp.h"
#include "stdio.h"

//--------------------------------------------------------------
testApp::testApp(){

}

//--------------------------------------------------------------
void testApp::setup(){
    colorWheel.loadImage("images/colorwheel.jpg");
    colorWheel.setAnchorPercent(0.5,0.5);
}

//--------------------------------------------------------------
void testApp::update(){
}


//--------------------------------------------------------------
void testApp::draw(){
    ofBackground(myColorPicker.getRed(),myColorPicker.getGreen(),myColorPicker.getBlue());
    colorWheel.draw(ofGetWidth()/2,ofGetHeight()/2);

}

//--------------------------------------------------------------
void testApp::keyPressed  (int key){
}

//--------------------------------------------------------------
void testApp::keyReleased(int key){

}

//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
}

//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
}

//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
    myColorPicker.grab(x,y);

    cout << "Red: ";
    cout << myColorPicker.getRed() << endl;
    cout << "Green: ";
    cout << myColorPicker.getGreen() << endl;
    cout << "Blue: ";
    cout << myColorPicker.getBlue() << endl;
//    cout << "Hexcode: ";
//    cout << myColorPicker.getHexCode() << endl;
    cout << "Hue: ";
    cout << myColorPicker.getHue() << endl;
    cout << "Saturation: ";
    cout << myColorPicker.getSaturation() << endl;
    cout << "Brightness: ";
    cout << myColorPicker.getBrightness() << endl;

    cout << myColorPicker.getHexCode() << endl;


}
//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){

}

//--------------------------------------------------------------
void testApp::resized(int w, int h){

}

